from apscheduler.schedulers.blocking import BlockingScheduler
from runner import Runner

scheduler = BlockingScheduler()
runner = Runner(3600)


@scheduler.scheduled_job("cron", hour="*/4", id="main")
def main():
    try:
        runner.run()
    except Exception as e:
        print(e)


try:
    scheduler.start()
except (KeyboardInterrupt, SystemExit):
    scheduler.shutdown()
